package com.huawei.boss.resources;

import java.beans.PropertyEditorSupport;

import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;

public class DatabaseResourceLoader extends PropertyEditorSupport {
    private ResourceLoader loader;

    public void setLoader(ResourceLoader loader) {
        this.loader = loader;
    }

    @Override
    public void setAsText(String text) {
        Resource resource = loader.getResource(text);
        setValue(resource);
    }
}